<?php

class Jj_model extends CI_Model {

	function test() {

		echo 'jjmodel teset';
	}
	
	function get_object_recommended($keyword) {

        $CI = &get_instance();
        $purview = $CI->login_lib->purview();
        $users_id = $CI->login_lib->users_id();



        if ($keyword != "")
            $this->db->like('case_name', $keyword);

         
        //if ($purview!='#all') {
            //$this->db->where('front_man', $users_id);
            //$this->db->where('broker', $users_id);
        //}

        $this->db->where('dtime', 0);
        $this->db->limit(10,0);
        $result=$this->db->get('h_object');


        $p = array();
        foreach ($result->result() as $val) {

            $p[$val->object_id]["case_name"] = urlencode($val->case_name);
            $p[$val->object_id]["building_name"] = urlencode($val->recommended);

        }
        return $p;
    }
}

